import {defineComponent} from "vue";
import {McpResponse} from "@/views/ai/agent/x6/mcp/types";
import RecommendProduct from "@/views/ai/agent/x6/mcp/result_card/RecommendProduct.vue";

const com={
  'recommendProductByKeyword':RecommendProduct,
}
export default defineComponent({
  props:{
    mcpResult:{
      type: Object as PropType<McpResponse>,
    }
  },
  setup(props){
    const child=computed(()=>{
      if (props.mcpResult){
        const name = props.mcpResult?.name;
        const comp=com[name]
        return h(comp,{mcpResult:props.mcpResult})
      }
      return h('div')
    })
    return ()=>h('div',{},[child.value])
  }
})
